<?php
include_once('../model/SendMail.php');

$result = false;

if(isset($_POST['From_Name']) && isset($_POST['From_Email']) && isset($_POST['From_Contact']) && isset($_POST['Message'])) {
	$body = '<style>table tr {height: 30px;min-height: 30px;}</style><div style="border: 1px solid; width: 600px; min-height: 300px;"><div style="width: 100%; min-height: 50px; background: #8DAE48; text-align: center; margin-top: -20px;"><h2 style="color: #FFF; padding-top: 10px;">THÔNG TIN LIÊN HỆ</h2></div><div style="min-height: 250px; padding: 5px;"><table><tr><th align="left" valign="top">Tên Khách Hàng:</th><td align="left" valign="top">'.$_POST['From_Name'].'</td></tr><tr><th align="left" valign="top">Email:</th><td align="left" valign="top">'.$_POST['From_Email'].'</td><tr><th align="left" valign="top">Số Điện Thoại:</th><td align="left" valign="top">'.$_POST['From_Contact'].'</td></tr><tr><th align="left" valign="top">Nội Dung:</th><td align="left" valign="top">'.$_POST['Message'].'</td></tr></table></div></div>';
	
	if(smtpmailer($_POST['From_Name']."_THÔNG TIN LIÊN HỆ", $body)) $result = true;
	echo json_encode($result);
	return;
}

echo json_encode($result);
?>